<template>
  <div class="contentBox setScrollbar setTabsHeight">
    <el-tabs
      v-model="activeName"
      @tab-click="handleClick"
    >
      <el-tab-pane
        label="讨论分类"
        name="first"
      >
        <dis-class
          v-if="activeName === 'first'"
          :curr-pid="pid"
          :type="type"
        />
      </el-tab-pane>
      <el-tab-pane
        label="问题分类"
        name="second"
      >
        <dis-class
          v-if="activeName === 'second'"
          :curr-pid="pid"
          :type="type"
        />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import disClass from './component/disClass';
export default {
  components: { disClass },
  data() {
    return {
      pid: '0',
      type: 'forum',
      activeName: 'first'
    };
  },
  methods: {
    handleClick(tab) {
      if(tab.name === 'first'){
        this.pid = '0'
        this.type = 'forum'
      } else{
        this.pid = '1'
        this.type = 'process'
      }
    }
  }
};
</script>
<style lang="scss" scoped>
  .line {
    padding-bottom: 20px;
    border-bottom: 1px solid #ccc;
  }
  .setTabsHeight {
    .el-tabs {
      height: 100%;
      min-height: 550px;
      /deep/.el-tabs__content {
        height: calc(100% - 55px);
        .el-tab-pane {
          height: 100%;
        }
      }
    }
  }
</style>
